package cn.cycleif.enums;

public enum ResultCodeEnum {

  // common
  SUCCESS(200, "success"),
  ERROR(10000, "error"),
  ERROR_UNKNOWN(10001, "error.known"),
  ERROR_NOT_EXIST(404, "error.not_exist"),
  // system
  ERROR_REQUEST_FORMAT(10002, "error.request_format_error"),
  ERROR_FORBIDDEN(10004, "error.forbidden"),
  ERROR_DATABASE(10005, "error.database_error"),
  ERROR_DUPLICATE_REQUEST(10006, "error.duplicate_request"),
  // user, auth
  ERROR_NOT_LOGIN(401, "error.not_login"),
  ERROR_NO_PERMISSION(403, "error.no_permission"),
  ERROR_PASSWORD_WRONG(11001, "error.password_wrong"),
  ERROR_EMAIL_WRONG(11002, "error.email_wrong"),
  ERROR_DISABLE_ACCOUNT(11003, "error.account_banned"),
  ERROR_USER_NOT_EXIST(11004, "error.user_not_exist"),
  ERROR_AUTH_EXPIRED(11005, "error.auth_expired"),
  ERROR_AUTH_INVALID(11006, "error.auth_invalid"),
  ERROR_VERIFY_CODE_WRONG(11007, "error.verify_code_wrong"),
  ERROR_PASSWORD_NOT_MATCH(11008, "error.password_not_match"),
  ERROR_HAS_RELATION(11009, "error.has_relation"),
  ERROR_NOT_ALLOW(11010, "error.not_allow");

  public final int    code;
  public final String desc;

  ResultCodeEnum(int code, String desc) {
    this.code = code;
    this.desc = desc;
  }
}
